import React, {Component, PropTypes} from 'react';
import zh_CN from './zh_CN';
/**
 * 基于react context 功能实现, 默认使用中文字符
 */

export default class I18n extends Component{

	static defaultProps = {
		lang: zh_CN
	}

	static propTypes = {
		lang: PropTypes.object
	}

	static childContextTypes = {
		lang: PropTypes.object
	}

	getChildContext(){
		return {
			lang: this.props.lang
		}
	}

	render(){
		return React.Children.only(this.props.children);
	}
}